package cn.hdu.liang.ch2;

public class Main {
    public static void main(String[] args) {
        try {
            String lock = new String();
            System.out.println("sync 之前");
            synchronized(lock) {
                System.out.println("进入sync");
                lock.wait();
                System.out.println("wait之后的代码");
            }
            System.out.println("sync之后");
        } catch(InterruptedException e) {
            e.printStackTrace();
        }
    }
}
